<?php
include_once('HtmlObject.php');
include_once('CollectionObject.php');
include_once('Table/Columns.php');
include_once('Table/Column.php');
include_once('Table/Header.php');
include_once('Table/Footer.php');
include_once('Table/Body.php');
include_once('Table/Caption.php');

class DynaGrid_Table extends DynaGrid_HTML_Object {
	protected $tagname = 'table';
	private $header;
	public $body;
	private $footer;
	public $caption;
	/**
	 * Is a collection object which stores the definitions on how
	 * columns are marked up, the format of the data they contain etc.
	 *
	 * @var DynaGrid_Table_Columns
	 */
	public $columns;
	public function __construct(DynaGrid_Dataset &$dataset) {				
		$this->columns = new DynaGrid_Table_Columns($dataset);
		$this->caption = new DynaGrid_Table_Caption();
		$this->header = new DynaGrid_Table_Header($this->columns);
		$this->body = new DynaGrid_Table_Body($this->columns);
		$this->footer = new DynaGrid_Table_Footer();
	}
	public function getHTML() {
		$this->innerHTML = $this->caption->getHTML();
		$this->innerHTML .= $this->header->getHTML();
		$this->innerHTML .= $this->body->getHTML();
		$this->innerHTML .= $this->footer->getHTML();
		
		return parent::getHTML();
	}
}